//
//  UIView+HDCityHeaderView.m
//  app
//
//  Created by D on 15/5/13.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "HDCityHeaderView.h"

static const CGFloat kImageHigth = 48.0f;
static const CGFloat kHeaderMargin = 24.0f;
static const CGFloat kLableHeight = 30.0f;
static const CGFloat kLableWight = 140.0f;

@implementation HDCityHeaderView

-(instancetype)initWithDelegate:(id)delegate
{
    if (self = [super init]) {
        self.frame = CGRectMake(0, 0, SCREEN_WIDTH, 56);
        
        self.rightImage = [[UIImageView alloc]initWithFrame:CGRectOf([self.ubo ux:kHeaderMargin fy:UB_1_2 uy:-kImageHigth+kImageHigth/2], [self.ubo uw:kImageHigth uh:kImageHigth])];
        [self.rightImage setImage:[UIImage imageNamed:@"address"]];
        [self addSubview:self.rightImage];
        
        self.cityLab = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo ux:kHeaderMargin+kHeaderMargin/2+kImageHigth fy:UB_1_2  uy:-kLableHeight*2], [self.ubo uw:kLableWight uh:kLableWight])];
        self.cityLab.font = JKAppGlobleFontMenu;
        [self addSubview:self.cityLab];
        
    }
    return self;
}

+(instancetype)viewWihtDelegate:(id)delegate
{
    return [[self alloc] initWithDelegate:delegate ];
}

-(void)drawRect:(CGRect)rect
{
    [self drawSeperatorLineLeft:UF(24) right:UF(0)];
}
@end
